import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.TreeSet;


public class Colecoes {

	List<String> lista;
	Set<String> listaUnica;
	Map<String,String> mapa;
	Queue<String> fila;
	
	public Colecoes() {

	}

	public static void main(String args[]){
		
		Colecoes c= FactoryColecoes.getInstance().getColecoes(OpcoesLista.LINKED_LIST, OpcoesSet.TREE_SET);
		c.lista.add("5");
		c.lista.add("1");
		c.lista.add("2");
		c.lista.add("3");
		c.lista.add("4");
		c.lista.add("4");
		c.lista.remove(2);
		
		c.listaUnica.add("5");
		c.listaUnica.add("5");
		c.listaUnica.add("1");
		c.listaUnica.add("1");
		c.listaUnica.add("2");
		c.listaUnica.add("3");
		c.listaUnica.add("4");


		LinkedList<String> ll = (LinkedList) c.lista;
		TreeSet<String> lhs = (TreeSet)c.listaUnica;
		
		//System.out.println(ll.);
		System.out.println("-------");
		
		//System.out.println(ll.pop()+"\n");
		
		
		c.percorreIterator(lhs);
		System.out.println(lhs.headSet("3"));
		
		
	}
	
	public void percorreIterator(Collection<String> colecao){
		Iterator<String> i = colecao.iterator();
		String item;
		
		while (i.hasNext()){
			item = i.next();
			System.out.println(item);
		}
	}
	

	
}


enum OpcoesLista{
	ARRAY_LIST,LINKED_LIST, VECTOR, STACK;
}

enum OpcoesSet{
	HASH_SET,LINKED_HASH_SET, TREE_SET;
}

